<template>
  <div class="mod-config">
    <table-view ref="view"
                :searchAttrs="searchAttrs"
                :primaryKey="primaryKey"
                :listApiName="listApiName"
                :deleteApiName="deleteApiName"
                :saveAuthName="saveAuthName"
                :deleteAuthName="deleteAuthName"
                :templateDownloadApiName="templateDownloadApiName"
                :exportApiName="exportApiName"
                :importApiName="importApiName"
                :showAttrs="showAttrs"
    >
    </table-view>
    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  </div>
</template>

<script>
import AddOrUpdate from './modelout-add-or-update'
import tableView from '@/components/tableView'
import basicMixins from '@/utils/commonViewMixins'

export default {
  mixins: [basicMixins],
  data() {
    return {
      searchAttrs: {
        modelInfoId:{
          type: 'autoComplete',
          placeholder:'模具编号',
          querySearchApiName: 'modelApi/getModelInfoList'
        },
        productNo: {
          label: '产品名称',
          placeholder: '请输入产品名称',
        },
        clientName: {
          placeholder:'客户名称'
        },
        dateTimeRange:{
          type: 'date',
          dateType: 'daterange',
          clearable: true
        }
      },
      primaryKey: 'id',
      listApiName: 'modelApi/listModelOut',
      deleteApiName: 'modelApi/deleteModelOut',
      saveAuthName: 'model:modelout:save',
      deleteAuthName: 'model:modelout:delete',
      templateDownloadApiName: 'modelApi/templateDownloadModelOut',
      importApiName: 'modelApi/importModelOut',
      exportApiName: 'modelApi/exportModelOut',
      showAttrs: {
        modelInfoNo: {label: '模具',width:120},
        modelShelfNo: {label: '货架',width:120},
        dayTime: { label:'日期', type: 'date',width:100},
        outType: {
          label:'出库类型',
          type: 'radio',
          width:100,
          items: [
            {value: 0, text: '报废', tagType: 'danger'},
            {value: 1, text: '客户调走'},
            {value: 2, text: '外发打样'},
            {value: 10, text: '外发做货',tagType: 'success'},
          ]},
        successMo: {label: '成模'},
        primaryMo: {label: '初模'},
        menTou: {label: '闷头'},
        louDou: {label: '漏斗'},
        kouZi: {label: '口子'},
        xinZi: {label: '芯子'},
        qiTou: {label: '气头'},
        jiaZi: {label: '夹子'},
        lengQue: {label: '冷却'},
        recipientPeople: {label: '提货人'},
        handlingPeople: {label: '经手人'},
        deliveryMethod: {label: '发货方式'},
        clientName: {label: '客户名称'},
        remark: {label: '备注'},
        status: {
          label: '状态',
          type: 'radio',
          items: [
            {value: 0, text: '禁用', tagType: 'danger'},
            {value: 1, text: '正常'}
          ]
        }
      }
    }
  },
  components: {
    AddOrUpdate,
    tableView
  }
}
</script>
